using System.IO;
using System.Linq;

namespace SmartStringResources
{
	internal class ResourceFileInfo
	{
		public ResourceFileInfo(string rootNamespace, string resourcesNamespace, string resourceFile)
		{
			RootNamespace = rootNamespace;
			ResourcesNamespace = resourcesNamespace;
			ResourceFile = resourceFile;
		}

		public string ResourceFile { get; private set; }
		public string RootNamespace { get; private set; }
		public string ResourcesNamespace { get; private set; }

		public string ResourcesClassName
		{
			get { return Path.GetFileNameWithoutExtension(ResourceFile); }
		}

		public string ResourceClassFullName
		{
			get { return ConcatNamespace(RootNamespace, ResourcesNamespace, ResourcesClassName); }
		}

		private static string ConcatNamespace(params string[] parts)
		{
			return string.Join(".", parts.Where(p => !string.IsNullOrEmpty(p)));
		}
	}
}